#ifndef _DevicesLed_H_
#define _DevicesLed_H_

#include "Version.h"




#define LED_VI_RED1         0x001
#define LED_VI_GREEN        0x002
#define LED_VI_YELLOW       0x004
#define LED_VI_RED2         0x008

#define LED_RED             0x010
#define LED_GREEN           0x020
#define LED_YELLOW          0x040

#define LED_TEMPERATURE_1   0x100
#define LED_TEMPERATURE_2   0x200

#define LED_ALL             0xFFFF










#define LED_VI_RED1_RCC_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_VI_RED1_GPIO_Port                GPIOE
#define LED_VI_RED1_Pin                      GPIO_PIN_10

#define LED_VI_GREEN_RCC_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_VI_GREEN_GPIO_Port               GPIOE
#define LED_VI_GREEN_Pin                     GPIO_PIN_11

#define LED_VI_YELLOW_RCC_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_VI_YELLOW_GPIO_Port              GPIOE
#define LED_VI_YELLOW_Pin                    GPIO_PIN_12

#define LED_VI_RED2_RCC_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_VI_RED2_GPIO_Port                GPIOE
#define LED_VI_RED2_Pin                      GPIO_PIN_13




//#define LED_RED_RCC_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOD_CLK_ENABLE()
//#define LED_RED_GPIO_Port                    GPIOD
//#define LED_RED_Pin                          GPIO_PIN_2

#define LED_GREEN_RCC_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_GREEN_GPIO_Port                  GPIOE
#define LED_GREEN_Pin                        GPIO_PIN_14

#define LED_YELLOW_RCC_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_YELLOW_GPIO_Port                 GPIOE
#define LED_YELLOW_Pin                       GPIO_PIN_15




#define LED_TEMPERATURE_1_RCC_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_TEMPERATURE_1_GPIO_Port                 GPIOE
#define LED_TEMPERATURE_1_Pin                       GPIO_PIN_8

#define LED_TEMPERATURE_2_RCC_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOE_CLK_ENABLE()
#define LED_TEMPERATURE_2_GPIO_Port                 GPIOE
#define LED_TEMPERATURE_2_Pin                       GPIO_PIN_9













typedef enum {
    LED_DISABLE = 0x1000,
    LED_ENABLE = 0x2000,
    LED_SLOW = 0x4000,
    LED_FAST = 0x8000,
} LedStateEnum;


typedef struct{
    uint16_t vi_red1;
    uint16_t vi_green;
    uint16_t vi_yellow;
    uint16_t vi_red2;

    uint16_t red;
    uint16_t green;
    uint16_t yellow;

    uint16_t temperature1;
    uint16_t temperature2;
}LedStateType;









void vLedInit(void);
void vLedOpen(uint16_t ucNumber);
void vLedClose(uint16_t ucNumber);
void vLedRevesal(uint16_t ucNumber);


#define LED_OPEN()      vLedOpen(LED_ALL)
#define LED_CLOSE()     vLedClose(LED_ALL)
#define LED_REVESAL()   vLedRevesal(LED_ALL)


#endif
